@extends('admin.layout.index')
@section('css')
<link rel="stylesheet" href="/web/css/page_page.css">
@endsection
@section('content')
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-table"></i> 促销商品列表 </span>
    </div>
    <div class="mws-panel-body no-padding">
        <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">
        <form action="/admin/goods/index" method='get'>
            <div id="DataTables_Table_1_length" class="dataTables_length">
            <label>显示
                <!--如果count或search值为空，就用默认值--> 
                <select name="count" size="1" aria-controls="DataTables_Table_1">
                    <option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
                    <option value="15" @if(!empty($request['count']) && $request['count'] == 15) selected @endif>15</option>
                    <option value="20" @if(!empty($request['count']) && $request['count'] == 20) selected @endif>20</option>
                    <option value="50" @if(!empty($request['count']) && $request['count'] == 50) selected @endif>50</option>
                </select> 条</label>
            </div>
            <div class="dataTables_filter" id="DataTables_Table_1_filter">
            <label>关键字: <input type="text" aria-controls="DataTables_Table_1" value='{{$request["search"] or ""}}' name='search'></label>
            <input type="submit" value='搜索'>
            </div>
        </form>
        <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
            <thead>
                <tr role="row">
                    <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">id</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 82px;" aria-label="Engine version: activate to sort column ascending">商品id</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 100px;" aria-label="Browser: activate to sort column ascending">货号</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Platform(s): activate to sort column ascending">商品原价格</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 82px;" aria-label="Engine version: activate to sort column ascending">促销价格</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Engine version: activate to sort column ascending">活动主题</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 56px;" aria-label="CSS grade: activate to sort column ascending">活动标语</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Engine version: activate to sort column ascending">开始时间</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Engine version: activate to sort column ascending">结束时间</th>
                </tr>
            </thead>   
        <tbody role="alert" aria-live="polite" aria-relevant="all">
                @foreach($data as $k => $v)
                <tr class="odd" style='text-align:center;height:30px'>
                    <td class="  sorting_1">{{$v['id']}}</td>
                    <td class=" ">{{$v['gid']}}</td>
                    <td class=" ">{{$v['articlenum']}}</td>
                    <td class=" ">{{$v['goodsprice']}}</td>
                    <td class=" ">{{$v['goodsdeprice']}}</td>
                    <td class=" ">{{$v['theme']}}</td>
                    <td class=" ">{{$v['slogan']}}</td>
                    <td class=" ">{{date('Y-m-d H:i:s',$v['starttime'])}}</td>
                    <td class=" ">{{date('Y-m-d H:i:s',$v['expiretime'])}}</td>
                    <td class=" ">
                        <a href="/admin/goods/depreciatedelete/{{$v['id']}}" style='color:black;margin-left:20px;font-size:16px' title='删除' onclick="return confirm('确认删除吗');"><i class="icon-remove"></i></a>
                        <a href="/admin/goods/depreciateedit/{{$v['id']}}" style='color:black;margin-left:20px;font-size:16px' title='修改'><i class="icon-pencil"></i></a>
                    </td>
                </tr>
                @endforeach
                </tbody></table>
                <div class="dataTables_info" id="DataTables_Table_1_info">显示 {{$start}} 到 {{$end}} 共 {{$sum}} 条</div>
                <!-- <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate"><a class="first paginate_button paginate_button_disabled" tabindex="0" id="DataTables_Table_1_first">First</a><a class="previous paginate_button paginate_button_disabled" tabindex="0" id="DataTables_Table_1_previous">Previous</a><span><a class="paginate_active" tabindex="0">1</a><a class="paginate_button" tabindex="0">2</a><a class="paginate_button" tabindex="0">3</a><a class="paginate_button" tabindex="0">4</a><a class="paginate_button" tabindex="0">5</a></span><a class="next paginate_button" tabindex="0" id="DataTables_Table_1_next">Next</a><a class="last paginate_button" tabindex="0" id="DataTables_Table_1_last">Last</a></div> -->
                <div class="dataTables_paginate paging_full_numbers" id="page_page">
                {!! $data -> appends($request) -> render() !!}
                </div>
        </div>
    </div>
</div>
@endsection